package com.cloud.pole.user.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.pole.user.biz.BaseUserBiz;
import com.cloud.pole.user.model.entity.BaseUser;
import com.cloud.pole.user.service.BaseUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import lombok.extern.slf4j.Slf4j;

@Service
@Slf4j
public class BaseUserServiceImpl implements BaseUserService {

	@Autowired
	private BaseUserBiz baseUserBiz;
	
	@Override
	public PageInfo<BaseUser> selectPageShopGoodsAdminList(Map<String, Object> map, Integer pageNo,
			Integer pageSize) throws Exception {
		PageHelper.startPage(pageNo, pageSize);
		List<BaseUser> list = baseUserBiz.selectPageShopGoodsAdminList(map);
		PageInfo<BaseUser> page = new PageInfo<BaseUser>(list);
		return page;
	}

	@Override
	public BaseUser selectById(Integer userId) throws Exception {
	
		return baseUserBiz.selectByBaseUserId(userId);
	}

	@Override
	public BaseUser selectByMarketCode(String marketCode) throws Exception {
		return baseUserBiz.selectByMarketCodeAp(marketCode);
	}

	@Override
	public void updayeByBaseUser(BaseUser baseUser) throws Exception {
		baseUserBiz.updateByToBaseUser(baseUser);
	}

}
